package commonClass.date;

import java.text.SimpleDateFormat;
import java.util.Date;

public class SimpleDateTime {
	private SimpleDateFormat sdf=null;
	
	public String getDate(){
		this.sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
		return this.sdf.format(new Date());
	}
	
	public String getCompleteDate(){
		this.sdf=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒SSS毫秒");
		return this.sdf.format(new Date());
	}
	
	/**
	 * 大写HH和小写hh的区别：
	 * HH当小时数超过12，还是显示本来的值，
	 * hh当小时数超过12，本来的值减去12
	 * @return
	 */
	public String getTimeStamp(){
		this.sdf=new SimpleDateFormat("yyyyMMdd HHmmssSSS");
		return this.sdf.format(new Date());
	}
	
	public static void main(String args[]){
		SimpleDateTime sdt=new SimpleDateTime();
		System.out.println(sdt.getDate());
		System.out.println(sdt.getCompleteDate());
		System.out.println(sdt.getTimeStamp());
		
	}
}
